<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>AdWords::Error</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
    <link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
    <script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
</head>

<body>     
    <div class="banner">
        <h1>
            <span class="type">Class</span> 
            AdWords::Error 
            
                <span class="parent">&lt; 
                    
                    Object
                    
                </span>
            
        </h1>
        <ul class="files">
            
            <li><a href="../../files/lib/adwords4r_rb.html">lib/adwords4r.rb</a></li>
            
        </ul>
    </div>
    <div id="bodyContent">
        <div id="content">
    
    <div class="description">
        <p>
<a href="Error/Error.html">Error</a> class to wrap several error types in
Ruby objects
</p>

    </div>
    

    

    
    

    
    
    <div class="sectiontitle">Methods</div>
    <dl class="methods">
    
        <dt>C</dt>
        <dd>
            <ul>
                
                <li><a href="#method-c-create_specific_api_error">create_specific_api_error</a></li>
                
            </ul>
        </dd>
    
    </dl>
    

    

    

    
    <div class="sectiontitle">Classes and Modules</div>
    <ul>
        
        <li><span class="type">CLASS</span> <a href="Error/AccountError.html">AdWords::Error::AccountError</a></li>
        
        <li><span class="type">CLASS</span> <a href="Error/ApiError.html">AdWords::Error::ApiError</a></li>
        
        <li><span class="type">CLASS</span> <a href="Error/AuthError.html">AdWords::Error::AuthError</a></li>
        
        <li><span class="type">CLASS</span> <a href="Error/BillingError.html">AdWords::Error::BillingError</a></li>
        
        <li><span class="type">CLASS</span> <a href="Error/EnvironmentMismatchError.html">AdWords::Error::EnvironmentMismatchError</a></li>
        
        <li><span class="type">CLASS</span> <a href="Error/Error.html">AdWords::Error::Error</a></li>
        
        <li><span class="type">CLASS</span> <a href="Error/GoogleInternalError.html">AdWords::Error::GoogleInternalError</a></li>
        
        <li><span class="type">CLASS</span> <a href="Error/RequestError.html">AdWords::Error::RequestError</a></li>
        
        <li><span class="type">CLASS</span> <a href="Error/UnknownAPICall.html">AdWords::Error::UnknownAPICall</a></li>
        
        <li><span class="type">CLASS</span> <a href="Error/UnknownType.html">AdWords::Error::UnknownType</a></li>
        
        <li><span class="type">CLASS</span> <a href="Error/WebpageError.html">AdWords::Error::WebpageError</a></li>
        
    </ul>
    

    

    

    
            <div class="sectiontitle">Class Public methods</div>
            
            <div class="method">
                <div class="title" id="method-c-create_specific_api_error">
                    
                    <a name="method-c-create_specific_api_error"></a><b>create_specific_api_error</b>(soap_fault)
                    
                </div>
                
                <div class="description">
                  <p>
Creates a specific <a href="Error/ApiError.html">ApiError</a> subclass,
based on the provided SOAP fault.
</p>
<p>
Args:
</p>
<ul>
<li><p>
soap_fault: the SOAP::FaultError on which to base this error
</p>
</li>
</ul>
<p>
Returns: A new instance of the appropriate subclass of <a
href="Error/ApiError.html">ApiError</a>
</p>

                </div>
                
                
                
                
                <div class="sourcecode">
                    <p class="source-link">
                        Source: <a href="javascript:toggleSource('method-c-create_specific_api_error_source')" id="l_method-c-create_specific_api_error_source">show</a>
                        
                    </p>
                    <div id="method-c-create_specific_api_error_source" class="dyn-source">
                        <pre>     <span class="ruby-comment cmt"># File lib/adwords4r.rb, line 307</span>
307:     <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">create_specific_api_error</span>(<span class="ruby-identifier">soap_fault</span>)
308:       <span class="ruby-identifier">error</span> = <span class="ruby-identifier">@@api_errors</span>[<span class="ruby-identifier">soap_fault</span>.<span class="ruby-identifier">faultcode</span>.<span class="ruby-identifier">text</span>.<span class="ruby-identifier">to_i</span>]
309:       <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">error</span>.<span class="ruby-identifier">nil?</span>
310:         <span class="ruby-keyword kw">return</span> <span class="ruby-constant">ApiError</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">soap_fault</span>)
311:       <span class="ruby-keyword kw">else</span>
312:         <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">eval</span>(<span class="ruby-node">&quot;#{error}.new(soap_fault)&quot;</span>)
313:       <span class="ruby-keyword kw">end</span>
314:     <span class="ruby-keyword kw">end</span></pre>
                    </div>
                </div>
                
            </div>
            
</div>
    </div>
  </body>
</html>    